package com.qiumo.gmtool.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qiumo.gmtool.entity.UserAuthEntity;
import com.qiumo.gmtool.mapper.UserAuthMapper;
import com.qiumo.gmtool.service.UserAuthService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class UserAuthServiceImpl extends ServiceImpl<UserAuthMapper, UserAuthEntity> implements UserAuthService {

    private final UserAuthMapper userAuthMapper;

    /**
     * 通过UID获取权限列表
     */
    @Override
    public List<UserAuthEntity> getAllPermByUid(String uid) {
        List<UserAuthEntity> userAuthEntities = userAuthMapper.selectList(new LambdaQueryWrapper<UserAuthEntity>()
            .eq(UserAuthEntity::getUid, uid));
        return userAuthEntities;
    }
}
